/**
 * 菜单模块API
 */

import axios from './request';

/**
 * 获取权限列表
 */
export const GetRightsList = () => axios.get('/menus/rightsList');

/**
 * 获取所有菜单列表
 * @returns 
 */
export const GetList = () => axios.get('/menus/list');

/**
 * 添加菜单
 * @returns 
 */
export const AddMenu = menu => axios.post('/menus/add', menu);

/**
 * 修改菜单
 * @returns 
 */
export const UpdateMenu = menu => axios.put('/menus/update', menu);

/**
 * 删除菜单
 * @param {*} id 要删除的菜单ID
 * @returns 
 */
export const DeleteMenu = id => axios.delete('/menus/delete/' + id);

/**
 * 根据角色ID获取菜单列表
 * @param {*} id 角色ID
 * @returns 
 */
export const GetMenusByRoleId = id => axios.get('/menus/listByRole/' + id);